package com.qin.mall.openfeign.product;

import com.qin.mall.common.api.CommonResult;
import com.qin.mall.common.api.MyBatisPlusPage;
import com.qin.mall.domain.PmsBrand;
import com.qin.mall.dto.BrandDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Leisure
 * create 2022 2022/11/19 10:05
 **/
@FeignClient("product-manage")
public interface BrandService {

    /**
     * 品牌管理
     */
    //查询所有品牌
    @GetMapping("/brandManage/listAll")
    public CommonResult<List<PmsBrand>> getBrandList$();
    
    //创建新的品牌
    @PostMapping("/brandManage/insetBrand")
    public CommonResult insetBrand$(@RequestBody BrandDto brandDto);
    
    //更新品牌
    @PostMapping("/brandManage/updateBrand")
    public CommonResult updateBrand$(@RequestParam(value = "id") Long id,
                              @RequestBody BrandDto brandDto);
    
    //通过id删除品牌
    @GetMapping("/brandManage/deleteBrandById/{id}")
    public CommonResult deleteBrand$(@PathVariable("id") Long id);
    
    //批量删除
    @PostMapping("/brandManage/deleteBrandByIdS")
    public CommonResult deleteBrands$(@RequestBody List<Long> ids);
    
    //品牌分页列表
    @GetMapping("/brandManage/selectListBrand")
    public CommonResult<MyBatisPlusPage<PmsBrand>> selectListBrand$(@RequestParam(value = "keyword", required = false) String keyword,
                                                                    @RequestParam (value = "pageNum")int pageNum,
                                                                    @RequestParam(value = "pageSize") int pageSize);

    //TODO 通过id获取品牌
    @GetMapping("/brandManage/selectOnId/{id}")
    public CommonResult<PmsBrand> selectById$(@PathVariable("id") Long id);
    
    //批量更新显示状态
    @PostMapping("/brandManage/updateOnShowStatus")
    public CommonResult updateShowStatus$(@RequestParam("ids") List<Long> ids,
                                   @RequestParam(value = "showStatus") Integer showStatus);

    //批量更新厂家制造商状态
    @PostMapping("/brandManage/updateOnFactoryStatus")
    public CommonResult updateFactoryStatus$(@RequestParam("ids") List<Long> ids,
                                      @RequestParam(value = "factoryStatus") Integer factoryStatus);



    
}
